package com.excilys.formation.projet.ebanking.webapp.controller;

import java.math.BigDecimal;

import javax.validation.constraints.AssertFalse;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class Virement {

	private int idCompteSource;

	private int idCompteDestination;

	@Digits(fraction = 2, integer = 8)
	@Min(value = 0)
	@NotNull
	private BigDecimal montant;

	@AssertFalse
	public boolean isValideComptes() {
		return idCompteDestination == idCompteSource;
	}

	public int getIdCompteSource() {
		return idCompteSource;
	}

	public void setIdCompteSource(int idCompteSource) {
		this.idCompteSource = idCompteSource;
	}

	public int getIdCompteDestination() {
		return idCompteDestination;
	}

	public void setIdCompteDestination(int idCompteDestination) {
		this.idCompteDestination = idCompteDestination;
	}

	public BigDecimal getMontant() {
		return montant;
	}

	public void setMontant(BigDecimal montant) {
		this.montant = montant;
	}
}
